﻿<UserControl x:Class="Prometheus.Binding.GettingStarted.MainPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:pro="http://prometheustoolkit.codeplex.com" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White">
        <pro:proForm x:Name="proForm">
            <StackPanel Orientation="Vertical">
                <TextBlock HorizontalAlignment="Left">
                    <TextBlock.Text>
                        <pro:proDelegateValueBinding BindingGroup="time" ProvideValue="provide_Time" />
                    </TextBlock.Text>
                </TextBlock>
                <Button Content="Update Time" Click="update_Time" HorizontalAlignment="Left" />
                <TextBox Name="txt" HorizontalAlignment="Left" Width="200">
                    <TextBox.Text>
                        <pro:proNullContextBinding BindingGroup="name">
                            <pro:proNotEmptyStringRule ErrorText="Please, enter your name" />
                        </pro:proNullContextBinding>
                    </TextBox.Text>
                </TextBox>
                <TextBlock DataContext="{Binding ElementName=txt}" HorizontalAlignment="Left">
                    <TextBlock.Text>
                        <pro:proReadOnlyBinding Path="Text" BindingGroup="name"
                                                UpdateGroupMode="UpdateTargetWhenGroupToData">
                            <pro:proAddTextConverter AddText="Hello, " Mode="Prefix" />
                        </pro:proReadOnlyBinding>
                    </TextBlock.Text>
                </TextBlock>
                <pro:proErrorBlock/>
            </StackPanel>
        </pro:proForm>
    </Grid>
</UserControl>